/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-21 11:12:13
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\extension\index.js
 * @CIMC-V2
 */
// 分割线
export function exDivider(num = 0) {
  return {
    [`divider_${num}`]: {
      type: 'exDivider',
    },
  }
}
// 输入框
export function exInput(name = '输入', value = 'value', tooltip = '') {
  return {
    type: 'exInput',
    name: name,
    value: value,
    tooltip: tooltip, //提示
  }
}
// 输入框
export function exTextarea(name = '输入', value = 'value', tooltip = '', rows = 1) {
  return {
    type: 'exTextarea',
    name: name,
    value: value,
    rows: rows,
    tooltip: tooltip, //提示
  }
}
//快捷键输入框
export function exInputKeyboardShortcut(name = '输入', value = 'value', tooltip = '') {
  return {
    type: 'exInputKeyboardShortcut',
    name: name,
    value: value,
    tooltip: tooltip, //提示
  }
}

// 切换
export function exSwitch(name = '切换', value = false, tooltip = '') {
  return {
    type: 'exSwitch',
    name: name,
    value: value,
    tooltip: tooltip, //提示
  }
}
// 下拉
export function exSelect(name = '下拉', value = 'text', options = []) {
  return {
    type: 'exSelect',
    name: name,
    value: value,
    options: options,
  }
}
// 可创建下来
export function exSelectAllowCreate(name = '下拉', value = 'text', options = [], placeholder = '') {
  return {
    type: 'exSelectAllowCreate',
    name: name,
    value: value,
    options: options,
    placeholder: placeholder,
  }
}
// 背景颜色下拉
export function exBgColorSelect(name = '背景颜色下拉', value = 'text') {
  return {
    type: 'exBgColorSelect',
    name: name,
    value: value,
  }
}
// 边框圆角下拉
export function exRoundedSelect(name = '边框圆角下拉', value = 'text') {
  return {
    type: 'exRoundedSelect',
    name: name,
    value: value,
  }
}
// 边框下拉
export function exBorderSelect(name = '边框下拉', value = 'text') {
  return {
    type: 'exBorderSelect',
    name: name,
    value: value,
  }
}
// 盒阴影下拉
export function exShadowSelect(name = '盒阴影下拉', value = 'text') {
  return {
    type: 'exShadowSelect',
    name: name,
    value: value,
  }
}
// 对齐方式下拉
export function exJustifySelect(name = '对齐方式下拉', value = 'text') {
  return {
    type: 'exJustifySelect',
    name: name,
    value: value,
  }
}
// 图片布局方式下拉
export function exImageFitSelect(name = '图片布局方式下拉', value = 'text') {
  return {
    type: 'exImageFitSelect',
    name: name,
    value: value,
  }
}
// 组件大小下拉
export function exSizeSelect(name = '组件大小下拉', value = 'text') {
  return {
    type: 'exSizeSelect',
    name: name,
    value: value,
  }
}
// 触发方式下拉
export function exExpandTriggerSelect(name = '触发方式下拉', value = 'text') {
  return {
    type: 'exExpandTriggerSelect',
    name: name,
    value: value,
  }
}
// 风格类型下拉
export function exStyleTypeSelect(name = '风格类型下拉', value = 'text') {
  return {
    type: 'exStyleTypeSelect',
    name: name,
    value: value,
  }
}
// 颜色选择
export function exColorPicker(name = '颜色', value = '#000000') {
  return {
    type: 'exColorPicker',
    name: name,
    value: value,
  }
}
// 数字input
export function exInputNumber(name = 'name', value = 100, min = -1, max = 500) {
  return {
    type: 'exInputNumber',
    controlsPosition: 'right',
    name: name,
    value: value,
    min,
    max,
  }
}
// 图标选择器
export function exIcon(name = '图标选择器', value = '') {
  return {
    type: 'exIcon',
    name: name,
    value: value,
  }
}

// 默认分页选择器
export function exDefaultNavigation(name = '默认分页', value = '') {
  return {
    type: 'exDefaultNavigation',
    name: name,
    value: value,
  }
}

// 单选按钮组
export function exRadioGroup(name = '单选按钮', value = '', list = []) {
  return {
    type: 'exRadioGroup',
    name: name,
    value: value,
    list: list,
    isExtend: true,
  }
}

// 扩展验证框
export function exValidateSelect(name = '下拉', value = 'text', options = []) {
  return {
    type: 'exValidateSelect',
    name: name,
    value: value,
    options: options,
  }
}
//预设内容
export function exPresetText(name = '预设内容', value = false, options = []) {
  return {
    type: 'exPresetText',
    name: name,
    value: value,
    options: options,
  }
}
// 自定义值
export function exCustomValue(name = '自定义值', value = 'Y') {
  return {
    type: 'exCustomValue',
    name: name,
    value: value,
  }
}

// 接口参数
export function exRequestData(name = '接口参数', value = []) {
  return {
    type: 'exRequestData',
    name: name,
    value: value,
  }
}

// 组件大小下拉
export function exPositionSelect(name = '位置下拉', value = 'text') {
  return {
    type: 'exPositionSelect',
    name: name,
    value: value,
  }
}
// 字符串操作（需要两个输入框的）
//
export function exStrFun(name = '字符串操作', intercept = [], division = [], replace = [], value = {}) {
  return {
    type: 'exStrFun',
    name: name,
    intercept: intercept, //字符串是否截取
    division: division, // 分割
    replace: replace, // 替换
    value: value,
  }
}

// pda扩展验证框
export function exPdaValidate(name = '验证') {
  return {
    type: 'exPdaValidate',
    name: name,
    value: {},
  }
}
export function exParams(name = '自定义参数', value = []) {
  return {
    type: 'exParams',
    name: name,
    value: value,
  }
}
export function exTag(name = '自定义参数', value = []) {
  return {
    type: 'exTag',
    name: name,
    value: value,
  }
}
// 带透明的颜色选择
export function exSetChartColor(name = '颜色', value = '#000000') {
  return {
    type: 'exSetChartColor',
    name: name,
    value: value,
  }
}
